<?php
/**
 * 附件服务层
 * @author maniac
 */
namespace app\common\service;

use app\common\model\Attaches AS AttachesModel;

class Attaches extends Base
{
    /**
     * 获取附件信息
     * @param  string $md5_file 文件 MD5 散列值
     */
    public function attach($md5_file)
    {
        $where = [
            'md5_file' => $md5_file,
        ];
        $info = AttachesModel::field('id,title,attach_uri')->where($where)->find();
        return $info ? $info->toArray() : false;
    }
}
